﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Isha.Data.Infrastructure;
using Isha.Entities;
using Isha.Repositories.Infrastructure;

namespace Isha.Repositories
{
    internal class ContentItemRepository : RepositoryBase<ContentItem>, IContentItemRepository
    {

        public ContentItemRepository(IDatabaseFactory databaseFactory)
            : base(databaseFactory)
        {

        }      

        public IEnumerable<ContentItem> GetChildContentItems(long Id)
        {
            var contentitems = GetMany(c => c.ParentItemID == Id && c.ExcludeNavigation == false).OrderBy(c => c.DisplayOrder);
            return contentitems;
        }      
    }
}
